<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8">
  <title>login</title>
  <link rel="stylesheet" href="lilei.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
  <!-- icheck bootstrap -->
  <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
  <!-- Theme style -->
  <link rel="stylesheet" href="dist/css/adminlte.min.css">
  <!-- Google Font: Source Sans Pro -->
  <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
</head>

<body>
  <div id="dljm">
    <div id="dlck">
      <div class="row" style="height: 100px;">
        <div style="position: absolute;font-size: 30px;width: 200px;margin-left:200px;margin-top: 50px;">登录控制台</div>
      </div>
      <div class="row" style="height:170px;">
        <div style="margin-top: 30px;margin-bottom: 20px;">
          <span style="margin-left: 100px;">账户：</span>
          <input id="account" type="text" v-model="account" style="margin-left: 30px;width:250px;height: 25px;"
            placeholder="账户：请输入账户名">
        </div>
        <div style="margin-top: 15px;margin-bottom: 20px;">
          <span style="margin-left: 100px;">密码：</span>
          <input id="pwd" type="text" v-model="pwd" style="margin-left: 30px;width:250px;height: 25px;"
            placeholder="密码：请输入密码">
        </div>


      </div>
      <div>
        <div style="margin-left: 140px;">
          <button id="login_button" v-on:click="login(account,pwd)"
            style="width: 300px;height: 50px;line-height: 10px;">登 录</button>
        </div>
      </div>

    </div>
  </div>
  <!-- jQuery -->
  <script src="plugins/jquery/jquery.min.js"></script>
  <!-- Bootstrap -->
  <script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
  <!-- AdminLTE -->
  <script src="dist/js/adminlte.js"></script>
  <!-- 引入VUE -->
  <script src="plugins/vue-2.6.10/vue-resource.min.js"></script>
  <script src="plugins/vue-2.6.10/vue.js"></script>
  <!-- 引入axios -->
  <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
  <script>
    new Vue({
      el: "#dlck",
      data: {
        account: "",
        pwd: "",
        yzm: ""
      },
      methods: {
        login: function (account, pwd) {
          $.ajax({
            url: "user1/login1",
            type: "post",
            data: {
              "account": this.account,
              "pwd": this.pwd,
            },
            success: function (res) {
              console.log(res);
              if (res.status == "success") {
                window.location.href = "index.html";
                var sessionStorage = window.sessionStorage;
                sessionStorage.setItem("account", account);
              }
            }
          });
        }
      }
    });
  </script>

</body>

</html>